package com.kfm.am.structure;

public class MyQueue extends Queue {
    Object[] arr;

    int count = 0;
    int capacity;

    MyQueue() {
        capacity = 10;
        arr = new Object[capacity];
    }

    MyQueue(int capacity) {
        this.capacity = capacity;
        arr = new Object[capacity];
    }

    @Override
    void enqueue(Object element) {
        arr[count++] = element;
    }

    @Override
    Object dequeue() {
        Object remove = arr[0];
        System.arraycopy(arr, 1, arr, 0, arr.length - 1);
        count--;
        return remove;
    }

    @Override
    Object peek() {
        return null;
    }

    @Override
    boolean isEmpty() {
        return false;
    }

    @Override
    int size() {
        return 0;
    }
}
